<template>
    <div>
        <van-nav-bar title="搜索" left-text="返回" left-arrow @click-left="() => { $router.back() }" />
        <van-search v-model="value" shape="round" background="#4fc08d" placeholder="请输入搜索关键词" />
        <div v-for="item in wgq">
            <router-link :to="'/xqy/'+item.goods_id">
                <van-cell-group>
                    <van-cell :title="item.goods_name"/>
                </van-cell-group>
            </router-link>
        </div>
    </div>
</template>

<script setup>
import { ref, watch } from 'vue'
import { qsearchApi } from '@/api/api'
let wgq = ref([])
let value = ref('')
watch(value, (value) => {
    qsearchApi(value).then(res => {
        console.log('搜索', res)
        wgq.value = res.data.message
    })
})
</script>

<style lang="scss" scoped></style>